package ch6;

public class Animal {
    private String name;
    protected double vit;

    public Animal(String name, double vit) {
        this.name = name;
        this.vit = vit;
    }
    public void show(){
        System.out.println("它的名字叫："+this.name+"，体力是："+this.vit);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getVit() {
        return vit;
    }

    public void setVit(double vit) {
        this.vit = vit;
    }
}

